feat(staged): add browser-accessible web mode#709
Draft
matt2e wants to merge 2 commits into
Draft
Conversation
863dbf1 to
808c1dd
Compare
Restore the full Axum HTTPS web server (previously stubbed) and implement
the frontend transport layer for running Staged in a browser. This enables
phone and desktop browser access to a running Staged instance.
Key changes:
- Unstub web_server::start() with TLS listener, static file serving, and
auth-protected API routes
- Add HTTP transport in invokeCommand() that POSTs to /api/invoke/{command}
with automatic 401 redirect to login
- Add WebSocket singleton for server-sent events in web mode
- Add WebLogin.svelte token entry screen with /api/auth session cookie flow
- Implement localStorage backend for persistentStore in web mode
- Expose web access token via Tauri command and settings UI with copy button
- Add `just dev-web` recipe requiring HTTPS cert/key env vars
- Add writeClipboardText/readClipboardText web fallbacks in transport layer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
…mode
Squash of local branch reload-when-i-leave-web. Adds a stale-while-revalidate
cache layer over Tauri commands so the frontend can serve persisted data
immediately on cold start and revalidate in the background, and refresh
automatically when a backgrounded web tab resumes from a Page Lifecycle
freeze.
Highlights:
- Service worker and web app manifest for PWA support, with automated cache
version generation in vite config
- Core SWR cache infrastructure backed by IndexedDB, including LRU eviction
for size management
- Tier 1/2/3 command wiring with post-mutation invalidation, branch-scoped
diff cache invalidation, and event-driven cache invalidation for real-time
updates
- Page Lifecycle listener that emits cache-stale events on resume, plus a
cache-invalidation listener and component-level handlers that re-fetch on
cache-stale (BranchCard, project home, sessions, etc.)
- Cached commands return { data, revalidating } so callers can render stale
data while a background refresh runs
- Fixes: markAllStale yields stale data before revalidating, side-effectful
refresh commands skip caching, in-flight reads no longer repopulate
invalidated cache, session message cache bypass on completion, timeline
cleanup promise chaining, awaited cache invalidation after mutations
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan